package com.tycmc.signelectroniccontracts.tools.net.tools;

import java.util.Map;

/**
 * Created by gaoyong on 2018/3/17.
 */

public class MapUtils {
    /**
     * 读Map中对应可以的值
     *
     * @param map     map
     * @param key     key
     * @param defalut 默认值
     * @return 获取值
     */
    public static String getString(Map<String, Object> map, String key, String defalut) {
        if (map != null) {
            if (map.get("key") != null) {
                return String.valueOf(key);
            }
        }
        return defalut;
    }

    /**
     * 获取Map中对应的值
     * @param map
     * @param key
     * @return
     */
    public static String getString(Map<String, Object> map, String key) {
        return getString(map, key, "");
    }
}
